﻿<UserControl xmlns:PageBar="clr-namespace:Mengsk.ProxyDelivery.App.UI.PageBar"  x:Class="Mengsk.ProxyDelivery.App.UI.Seller.SellerShopUserControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="1000" Loaded="UserControl_Loaded">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>

        <StackPanel Grid.Row="0" Orientation="Horizontal">
            <TextBlock Text="店铺平台:" Margin="3" VerticalAlignment="Center"/>
            <ComboBox Name="cbbPopTypes" Margin="3" VerticalAlignment="Center" Width="80"/>

            <TextBlock Text="卖家编号:" Margin="3" VerticalAlignment="Center"/>
            <TextBox Name="tbSellerId" Margin="3" VerticalAlignment="Center" Width="100"/>

            <TextBlock Text="店铺账号:" Margin="3" VerticalAlignment="Center"/>
            <TextBox Name="tbPopSellerName" Margin="3" VerticalAlignment="Center" Width="100"/>

            <TextBlock Text="店铺名称:" Margin="3" VerticalAlignment="Center"/>
            <TextBox Name="tbPopShopName" Margin="3" VerticalAlignment="Center" Width="100"/>

            <Button Name="btnSearch" Content="查询" Width="60" Margin="3" VerticalAlignment="Center" Click="btnSearch_Click"/>
        </StackPanel>

        <DataGrid Grid.Row="1" AutoGenerateColumns="False" IsReadOnly="True" GridLinesVisibility="All" SelectionUnit="FullRow" SelectionMode="Single" Name="dgvShop" CanUserAddRows="False">
            <DataGrid.Columns>
                <DataGridTextColumn Header="店铺编号" Binding="{Binding Id}"/>
                <DataGridTextColumn Header="卖家编号" Binding="{Binding SellerId}"/>
                <DataGridTextColumn Header="店铺平台" Binding="{Binding PopType,Converter={StaticResource  descriptionConverter}}"/>
                <DataGridTextColumn Header="店铺账号" Binding="{Binding PopSellerName}"/>
                <DataGridTextColumn Header="店铺名称" Binding="{Binding PopShopName}"/>
                <DataGridTextColumn Header="授权创建时间" Binding="{Binding CreateTime,StringFormat=yyyy-MM-dd HH:mm:ss}"/>
                <DataGridTextColumn Header="授权结束时间" Binding="{Binding AccessTokenEndTime,StringFormat=yyyy-MM-dd HH:mm:ss}"/>
                <DataGridTextColumn Header="更新时间" Binding="{Binding UpdateTime,StringFormat=yyyy-MM-dd HH:mm:ss}"/>
                <DataGridHyperlinkColumn Header="店铺地址" Binding="{Binding PopShopUrl}" Width="*">
                    <DataGridHyperlinkColumn.ElementStyle>
                        <Style>
                            <EventSetter Event="Hyperlink.Click" Handler="Open_Click"/>
                        </Style>
                    </DataGridHyperlinkColumn.ElementStyle>
                </DataGridHyperlinkColumn>
            </DataGrid.Columns>
        </DataGrid>
        <PageBar:PageBarUserControl Grid.Row="2" x:Name="pbBar" PageChanging="pbBar_PageChanging"  PageSize="200"/>
    </Grid>
</UserControl>
